{$CLEO .cs}
{$USE cleo+} 

0000:
THREAD 'PITTY_ISLAND'  
  
load_animation   "PARACHUTE"
 
const
   evil_car =  0@
   any_npcs   =   1@ 
   DROPPED =4@ 
   sound_fall = 5@
   sound_death_pitty = 6@ 
   sound_death_pitty_player1 = 7@ 
   sound_death_pitty_player2 = 8@ 
    
   sound_fall2 = 9@
end 
    
 
   sound_fall= audiostream.Load3D("cleo\[special]\SLAM.wav")
   sound_death_pitty= audiostream.Load3D("cleo\[special]\hitblood01.wav")
   sound_death_pitty_player1 = audiostream.Load3D("cleo\[special]\hitblood01.wav")
   sound_death_pitty_player2 = audiostream.Load3D("cleo\[special]\hitblood01.wav")
   sound_fall2 =audiostream.Load3D("cleo\[special]\SLAM.wav")
  
while true 
wait 0
    gosub @KILL_PITS_PLAYERS
    gosub @KILL_PITS
    
 
    if     00FE:   actor local_player sphere 0 in_sphere  -5344.5127 415.4449 8.8952 radius 2.0 2.0 1.2 on_foot
    then
        camera.SetBehindPlayer()
        camera.Restore_WithJumpCut()
        
        actor_remove_from_car_and_put_at player1 -5314.4087 210.2995 38.1252
        actor_angle player1 142.6424
        if coop
        then
        actor_remove_from_car_and_put_at player2  -5313.5723 211.6809 38.0754
        actor_angle player2  142.6424
        
        end
    end
    if  00FE:   actor local_player sphere 0 in_sphere  -5363.7549 39.3953 53.2298  radius 2.0 2.0 1.2 on_foot
    then
        camera.SetBehindPlayer()
        camera.Restore_WithJumpCut()    
            actor_remove_from_car_and_put_at player1  -5323.0337 39.165 137.8323
            actor_angle player1  311.9704 
            if coop
            then
            actor_remove_from_car_and_put_at player2  -5316.8555 44.2454 137.6844
            actor_angle player2  311.9704 
            
            end    
    end
 
   
end 
release_animation "PARACHUTE"
                     
audiostream.Release(sound_death_pitty)
audiostream.Release( sound_fall2)
audiostream.Release(sound_death_pitty_player1)
audiostream.Release(sound_death_pitty_player2)
audiostream.Release( sound_fall ) 

  
end_thread  

:KILL_PITS_PLAYERS
         if not  actor.Dead(     local_player )
         then
           if 00A4:   actor local_player sphere 0 in_cube_cornerA  -5383.1016 401.6186 0.193 cornerB -5268.563 466.3884 2.3968  on_foot
           then
              gosub @KILL_PLAYER1 
           end
           if 00A4:   actor local_player sphere 0 in_cube_cornerA  -5535.2437 388.3729 1.1488 cornerB -5325.5273 557.578 2.42 on_foot
           then
              gosub @KILL_PLAYER1 
           end
           if 00A4:   actor local_player sphere 0 in_cube_cornerA  -5583.1099 580.7123 -2.5898 cornerB -5453.6543 643.2092 0.7917  on_foot
           then
              gosub @KILL_PLAYER1 
           end
           if 00A4:   actor local_player sphere 0 in_cube_cornerA  -5402.458 387.4615 -7.4513 cornerB -5550.8262 560.1405 2.5487 on_foot
           then
              gosub @KILL_PLAYER1
           end           
           if 00FE:   actor local_player sphere 0 in_sphere  -4927.0361 733.6569 4.298 radius 9.0 9.0 1.5 on_foot
           then
               gosub @KILL_PLAYER1 
           end 
           if 00FE:   actor local_player sphere 0 in_sphere   -4907.1221 846.0708 4.497 radius 11.0 11.0 1.6 on_foot
           then
               gosub @KILL_PLAYER1 
           end 
           if 00FE:   actor local_player sphere 0 in_sphere  -4469.2144 662.3627 2.3688   radius 9.0 9.0 1.1 on_foot
           then
               gosub @KILL_PLAYER1
           end 
           if 00FE:   actor local_player sphere 0 in_sphere  -5481.8726 601.6417 1.8188  radius 20.0 20.0 2.1 on_foot
           then
               gosub @KILL_PLAYER1
           end 
           if 00FE:   actor local_player sphere 0 in_sphere  -5560.6992 608.5793 1.2988 radius 20.0 20.0 2.1 on_foot
           then
               gosub @KILL_PLAYER1
           end 
           if 00A4:   actor local_player sphere 0 in_cube_cornerA -5412.0483 1.8794 14.08  cornerB -5273.8687 225.5894 26.08  on_foot
           then
              gosub @KILL_PLAYER1
           end           
           
         end
      if coop
      then
         if not  actor.Dead( remote_player )
         then                              
           if 00A4:   actor remote_player sphere 0 in_cube_cornerA  -5383.1016 401.6186 0.193 cornerB -5268.563 466.3884 2.3968  on_foot
           then
              gosub @KILL_PLAYER2 
           end
           if 00A4:   actor remote_player sphere 0 in_cube_cornerA  -5535.2437 388.3729 1.1488 cornerB -5325.5273 557.578 2.42 on_foot
           then
              gosub @KILL_PLAYER2 
           end
           if 00A4:   actor remote_player sphere 0 in_cube_cornerA  -5583.1099 580.7123 -2.5898 cornerB -5453.6543 643.2092 0.7917  on_foot
           then
              gosub @KILL_PLAYER2 
           end
           if 00A4:   actor remote_player sphere 0 in_cube_cornerA  -5402.458 387.4615 -7.4513 cornerB -5550.8262 560.1405 2.5487 on_foot
           then
              gosub @KILL_PLAYER2 
           end
           if 00FE:   actor remote_player sphere 0 in_sphere  -4927.0361 733.6569 4.298 radius 9.0 9.0 1.5 on_foot
           then
               gosub @KILL_PLAYER2 
           end 
           if 00FE:   actor remote_player sphere 0 in_sphere   -4907.1221 846.0708 4.497 radius 11.0 11.0 1.6 on_foot
           then
               gosub @KILL_PLAYER2 
           end 
           if 00FE:   actor remote_player sphere 0 in_sphere  -4469.2144 662.3627 2.3688   radius 9.0 9.0 1.1 on_foot
           then
               gosub @KILL_PLAYER2
           end 
           if 00FE:   actor remote_player sphere 0 in_sphere  -4469.2144 662.3627 2.3688   radius 9.0 9.0 1.1 on_foot
           then
               gosub @KILL_PLAYER2
           end 
           if 00FE:   actor remote_player sphere 0 in_sphere  -5481.8726 601.6417 1.8188  radius 20.0 20.0 2.1 on_foot
           then
               gosub @KILL_PLAYER2 
           end 
           if 00FE:   actor remote_player sphere 0 in_sphere  -5560.6992 608.5793 1.2988 radius 20.0 20.0 2.1 on_foot
           then
               gosub @KILL_PLAYER2
           end        
           if 00A4:   actor remote_player sphere 0 in_cube_cornerA -5412.0483 1.8794 14.08  cornerB -5273.8687 225.5894 26.08  on_foot
           then
              gosub @KILL_PLAYER2
           end           
                      
               
         end
      end
return 

:KILL_PLAYER1
 
audiostream.LinkToActor(sound_death_pitty_player1,  local_player)
audiostream.PerformAction(sound_death_pitty_player1, PLAY     )
04C4: store_coords_to  21@ 22@ 23@ from_actor local_player with_offset 0.0 0.0 0.0   
09B8: create_blood_gush_at 21@ 22@ 23@ with_offset 0.0 0.0 0.0    density 100 on_actor local_player

0792: disembark_instantly_actor local_player

0851: set_actor local_player decrease_health_by 99999999999 affect_armour 0
 
0829: actor local_player perform_animation "FALL_skyDive_DIE" IFP_file "PARACHUTE" rate 4.0 time 0 and_dies
    if not  actor.Dead(local_player)
    then
             
                if 00FE:   actor local_player sphere 0 in_sphere  -5441.0781 599.4926 4.55  radius 60.0 60.0 60.0
                then
                   actor_remove_from_car_and_put_at local_player  -5441.0781 599.4926 4.55
                   actor_angle  local_player 87.2595
                end 
                if 00FE:   actor local_player sphere 0 in_sphere  -5489.0522 423.7189 5.7614 radius 40.0 40.0 30.0
                then
                   actor_remove_from_car_and_put_at local_player -5499.0723 523.9386 4.5487
                   actor_angle  local_player  182.3244
                end 
                if 00FE:   actor local_player sphere 0 in_sphere -5310.1924 426.3933 11.4521   radius 30.0 30.0 30.0
                then
                   actor_remove_from_car_and_put_at local_player -5390.5654 414.4252 4.5487
                   actor_angle local_player 270.3682
                end 
                if 00FE:   actor local_player sphere 0 in_sphere  -4905.6475 844.5641 8.8649  radius 20.0 20.0 20.0
                then
                   actor_remove_from_car_and_put_at local_player -4939.2842 835.068 10.01
                   actor_angle local_player 266.7978
                end             
                if 00FE:   actor local_player sphere 0 in_sphere  -4928.7256 734.9879 8.3681  radius 20.0 20.0 20.0
                then
                   actor_remove_from_car_and_put_at local_player  -4904.4956 736.8306 7.8888
                   actor_angle local_player 90.5576
                end 
                if 00FE:   actor local_player sphere 0 in_sphere -4470.3008 663.3243 6.9291   radius 20.0 20.0 20.0
                then
                   actor_remove_from_car_and_put_at local_player -4467.5703 689.3738 5.049 
                   actor_angle local_player  185.0659
                end 
                if 00FE:   actor local_player sphere 0 in_sphere  -5511.6162 598.6508 7.9327  radius 50.0 50.0 50.0
                then
                   actor_remove_from_car_and_put_at local_player  -5517.7388 600.8935 4.5487
                   actor_angle local_player 185.0108  
                end               
    end
 

return 

:KILL_PLAYER2
if coop
then
audiostream.LinkToActor(sound_death_pitty_player2, remote_player)
audiostream.PerformAction(sound_death_pitty_player2, PLAY)
04C4: store_coords_to  21@ 22@ 23@ from_actor remote_player with_offset 0.0 0.0 0.0   
09B8: create_blood_gush_at 21@ 22@ 23@ with_offset 0.0 0.0 0.0    density 100 on_actor remote_player

0792: disembark_instantly_actor remote_player

0851: set_actor remote_player decrease_health_by 99999999999 affect_armour 0
 
0829: actor remote_player perform_animation "FALL_skyDive_DIE" IFP_file "PARACHUTE" rate 4.0 time 0 and_dies
    if not actor.Dead(remote_player)
    then
            if coop
            then
                if 00FE:   actor remote_player sphere 0 in_sphere  -5441.0781 599.4926 4.55  radius 60.0 60.0 60.0
                then
                   actor_remove_from_car_and_put_at remote_player  -5441.0781 599.4926 4.55
                   actor_angle  remote_player 87.2595
                end 
                if 00FE:   actor remote_player sphere 0 in_sphere  -5489.0522 423.7189 5.7614 radius 40.0 40.0 30.0
                then
                   actor_remove_from_car_and_put_at remote_player -5499.0723 523.9386 4.5487
                   actor_angle  remote_player  182.3244
                end 
                if 00FE:   actor remote_player sphere 0 in_sphere -5310.1924 426.3933 11.4521   radius 30.0 30.0 30.0
                then
                   actor_remove_from_car_and_put_at remote_player -5390.5654 414.4252 4.5487
                   actor_angle remote_player 270.3682
                end 
                if 00FE:   actor remote_player sphere 0 in_sphere  -4905.6475 844.5641 8.8649  radius 20.0 20.0 20.0
                then
                   actor_remove_from_car_and_put_at remote_player -4939.2842 835.068 10.01
                   actor_angle remote_player 266.7978
                end             
                if 00FE:   actor remote_player sphere 0 in_sphere  -4928.7256 734.9879 8.3681  radius 20.0 20.0 20.0
                then
                   actor_remove_from_car_and_put_at remote_player  -4904.4956 736.8306 7.8888
                   actor_angle remote_player 90.5576
                end 
                if 00FE:   actor remote_player sphere 0 in_sphere -4470.3008 663.3243 6.9291   radius 20.0 20.0 20.0
                then
                   actor_remove_from_car_and_put_at remote_player -4467.5703 689.3738 5.049 
                   actor_angle remote_player  185.0659
                end 
                if 00FE:   actor remote_player sphere 0 in_sphere  -5511.6162 598.6508 7.9327  radius 50.0 50.0 50.0
                then
                   actor_remove_from_car_and_put_at remote_player  -5517.7388 600.8935 4.5487
                   actor_angle remote_player 185.0108  
                end 
            end
    end
end

return 

 
:KILL_PITS
   0AE1: any_npcs = random_char_near_point  -5383.1016 401.6186 0.193 in_radius 99999999.0 find_next 1 pass_deads 1
      if is_actor_defined any_npcs
      then
           if 00A4:   actor any_npcs sphere 0 in_cube_cornerA  -5383.1016 401.6186 0.193 cornerB -5268.563 466.3884 2.3968  on_foot
           then
              gosub @KILL_CHAR 
           end
           if 00A4:   actor any_npcs sphere 0 in_cube_cornerA  -5535.2437 388.3729 1.1488 cornerB -5325.5273 557.578 2.42 on_foot
           then
              gosub @KILL_CHAR 
           end
           if 00A4:   actor any_npcs sphere 0 in_cube_cornerA  -5583.1099 580.7123 -2.5898 cornerB -5453.6543 643.2092 0.7917  on_foot
           then
              gosub @KILL_CHAR 
           end
           if 00FE:   actor any_npcs sphere 0 in_sphere  -4927.0361 733.6569 4.298 radius 9.0 9.0 1.5 on_foot
           then
               gosub @KILL_CHAR 
           end 
           if 00FE:   actor any_npcs sphere 0 in_sphere   -4907.1221 846.0708 4.497 radius 11.0 11.0 1.6 on_foot
           then
               gosub @KILL_CHAR 
           end 
           if 00FE:   actor any_npcs sphere 0 in_sphere  -4469.2144 662.3627 2.3688   radius 9.0 9.0 1.1 on_foot
           then
               gosub @KILL_CHAR 
           end 
           if 00FE:   actor any_npcs sphere 0 in_sphere  -5481.8726 601.6417 1.8188  radius 20.0 20.0 2.1 on_foot
           then
               gosub @KILL_CHAR 
           end 
           if 00FE:   actor any_npcs sphere 0 in_sphere  -5560.6992 608.5793 1.2988 radius 20.0 20.0 2.1 on_foot
           then
               gosub @KILL_CHAR
           end            
           if 00A4:   actor any_npcs sphere 0 in_cube_cornerA  -5402.458 387.4615 -7.4513 cornerB -5550.8262 560.1405 2.5487 on_foot
           then
              gosub @KILL_CHAR
           end             
           if 00A4:   actor any_npcs sphere 0 in_cube_cornerA -5412.0483 1.8794 14.08  cornerB -5273.8687 225.5894 26.08  on_foot
           then
              gosub @KILL_CHAR
           end                        
           {
           //Test Paths
           if 00FE:   actor any_npcs sphere 0 in_sphere  -4927.0361 733.6569 4.298 radius 15.0 15.0 4.5 on_foot
           then
           
                0615: define_AS_pack_begin test_path
               // 05D3: AS_actor -1  goto_point 681.8004 -474.1063 15.5363 mode 4 time 3000 ms // versionA
               05D3: AS_actor -1 go_to -5345.7788 796.6702 4.4552  mode 7 time 999999 //stop_radius 5.0  following_paths 
               05D3: AS_actor -1 go_to  -5380.8608 727.683 5.5671 mode 7 time 999999 //stop_radius 5.0  following_paths 
               05D3: AS_actor -1 go_to -5406.3667 623.3184 5.0956  mode 7 time 999999 //stop_radius 5.0  following_paths 
               05D3: AS_actor -1 go_to  -5462.6328 608.5533 5.3603 mode 7 time 999999 //stop_radius 5.0  following_paths 
               05D3: AS_actor -1 go_to -5518.6548 608.8405 6.3435  mode 7 time 999999 //stop_radius 5.0  following_paths 
               05D3: AS_actor -1 go_to -5514.5859 558.5312 5.6284   mode 7 time 999999 //stop_radius 5.0  following_paths 
               05D3: AS_actor -1 go_to -5496.6904 558.0404 5.2192  mode 7 time 999999 //stop_radius 5.0  following_paths 
               05D3: AS_actor -1 go_to -5499.0044 514.2734 4.9314  mode 7 time 999999 //stop_radius 5.0  following_paths 
               
               // 0643: set_AS_pack test_path loop 1
                  05D3: AS_actor $PLAYER_ACTOR goto_point 681.8004 -474.1063 15.5363 mode 4 time 3000 ms // versionA

                // define_AS_pack_end test_path
                0618: assign_actor any_npcs to_AS_pack test_path
                061B: remove_references_to_AS_pack test_path                 
           end            
           if 00FE:   actor any_npcs sphere 0 in_sphere -5333.1196 388.972 5.1528 radius 8.0 8.0 3.5 on_foot
           then
           
                0615: define_AS_pack_begin test_path
               // 05D3: AS_actor -1  goto_point 681.8004 -474.1063 15.5363 mode 4 time 3000 ms // versionA
               05D3: AS_actor -1 go_to -5333.686 373.9614 4.5487  mode 7 time 999999 //stop_radius 5.0  following_paths   
               05D3: AS_actor -1 go_to  -5350.2725 373.8612 4.6153 mode 7 time 999999 //stop_radius 5.0  following_paths   
               05D3: AS_actor -1 go_to  -5350.2617 359.7199 4.6147 mode 7 time 999999 //stop_radius 5.0  following_paths   
               05D3: AS_actor -1 go_to  -5360.9902 358.4714 0.6353 mode 7 time 999999 //stop_radius 5.0  following_paths   
               05D3: AS_actor -1 go_to -5360.7197 347.5739 0.6357  mode 7 time 999999 //stop_radius 5.0  following_paths   
               05D3: AS_actor -1 go_to -5368.5967 346.9091 0.6354  mode 7 time 999999 //stop_radius 5.0  following_paths   
               05D3: AS_actor -1 go_to -5371.3838 309.2575 0.6356  mode 7 time 999999 //stop_radius 5.0  following_paths   
              05DE: AS_actor -1  walk_around_ped_path
               // 0643: set_AS_pack test_path loop 1

                // define_AS_pack_end test_path
                0618: assign_actor any_npcs to_AS_pack test_path
                061B: remove_references_to_AS_pack test_path                 
           end            
           if 00FE:   actor any_npcs sphere 0 in_sphere -5004.5459 848.0821 11.3787 radius 20.0 21.0 4.5 on_foot
           then
           
                0615: define_AS_pack_begin test_path
               // 05D3: AS_actor -1  goto_point 681.8004 -474.1063 15.5363 mode 4 time 3000 ms // versionA
               05D3: AS_actor -1 go_to  -4915.9805 864.4327 10.8758  mode 7 time 999999 //stop_radius 5.0  following_paths  
               05D3: AS_actor -1 go_to   -4821.021 853.1754 5.067 mode 7 time 999999 //stop_radius 5.0  following_paths  
               05D3: AS_actor -1 go_to  -4706.002 841.4507 4.9785  mode 7 time 999999 //stop_radius 5.0  following_paths  
               05D3: AS_actor -1 go_to  -4539.2778 824.9184 6.6195  mode 7 time 999999 //stop_radius 5.0  following_paths  
               05D3: AS_actor -1 go_to  -4528.9341 741.3268 5.9875  mode 7 time 999999 //stop_radius 5.0  following_paths  
               05D3: AS_actor -1 go_to   -4485.5249 643.7595 5.2457 mode 7 time 999999 //stop_radius 5.0  following_paths  
               05D3: AS_actor -1 go_to  -4530.3906 537.1475 5.1929  mode 7 time 999999 //stop_radius 5.0  following_paths  
      
              05DE: AS_actor -1  walk_around_ped_path
               // 0643: set_AS_pack test_path loop 1

                // define_AS_pack_end test_path
                0618: assign_actor any_npcs to_AS_pack test_path
                061B: remove_references_to_AS_pack test_path                 
           end        
           }    
      end
return 


:KILL_CHAR 
audiostream.LinkToActor(sound_death_pitty, any_npcs)
audiostream.PerformAction(sound_death_pitty,play)
04C4: store_coords_to  21@ 22@ 23@ from_actor any_npcs with_offset 0.0 0.0 0.0   
09B8: create_blood_gush_at 21@ 22@ 23@ with_offset 0.0 0.0 0.0    density 100 on_actor any_npcs

0792: disembark_instantly_actor any_npcs

0851: set_actor any_npcs decrease_health_by 99999999999 affect_armour 0
//05BE: AS_actor any_npcs die
//0762: AS_actor any_npcs dies
0829: actor any_npcs perform_animation "FALL_skyDive_DIE" IFP_file "PARACHUTE" rate 4.0 time 0 and_dies

return 

:scene
{
    0665: get_actor  local_player model_to PLAYER1_SKIN
    if coop
    then
        0665: get_actor   remote_player model_to PLAYER2_SKIN

    end
            }
            
   {         
    if  
      023D:   special_actor 10 loaded
    then
        0503: create_actor_on_rope_with_pedtype 34 model #SPECIAL10 at -5313.6489 207.094 80.9424  handle_as fake_rope_player1
    else
        0503: create_actor_on_rope_with_pedtype 34 model #NULL at -5313.6489 207.094 80.9424 handle_as fake_rope_player1

    end
    if coop
    then
        if  
          023D:   special_actor 9 loaded
        then
            0503: create_actor_on_rope_with_pedtype 34 model #SPECIAL09 at -5319.6294 206.6128 80.9424  handle_as fake_rope_player2
        else
            0503: create_actor_on_rope_with_pedtype 34 model #NULL at  -5319.6294 206.6128 80.9424  handle_as fake_rope_player2
    
        end
    end
    015F: set_camera_position -5317.7139 212.4916 39.009 rotation 0.0 0.0 0.0
    0160: set_camera_point_at -5319.6294 206.6128 80.9424 switchstyle 2
    
    wait 3000

    if is_actor_defined  fake_rope_player1
    then
       actor.DestroyInstantly( fake_rope_player1 )
    end
    if is_actor_defined  fake_rope_player2
    then
       actor.DestroyInstantly( fake_rope_player2 )
    end
    }

    
return